if (self.CavalryLogger) { CavalryLogger.start_js(["lPZ+5"]); } __d("AppUseTrackerLogger",["AsyncRequest","PageTransitions","Run","isInIframe","pageID"],(function(a,b,c,d,e,f){__p&&__p();function g(){g.instance||(g.instance=this);return g.instance}Object.assign(g,{setup:function(a,b,c,d,e,f){new g().init(a,b,c,d,e,f)}});Object.assign(g.prototype,{instance:null,endpoint:"/ajax/apps/usage_update.php",heartbeat_endpoint:"/ajax/apps/heartbeat.php",INITIAL_PING:0,ONGOING_PING:1,DISCOVERY_PING:2,ENDING_PING:3,_application_id:0,_is_game:0,_createRequest:function(a){return new(b("AsyncRequest"))().setURI(this.endpoint).setMethod("POST").setData({app:this._application_id,is_game:this._is_game,type:a,condition:this._signal_on_page_transition})},_createHeartbeatRequest:function(){return new(b("AsyncRequest"))().setURI(this.heartbeat_endpoint).setMethod("POST").setData({app:this._application_id,page_id:b("pageID")})},init:function(a,c,d,e,f,g){__p&&__p();var h=this;if(b("isInIframe")())return;this.cleanup();b("PageTransitions").registerHandler(this.catchPageTransition.bind(this));this._application_id=a;this._is_game=c;if(g){a=function(){return h._createHeartbeatRequest().send()};a();this._timers.push(setInterval(a,g))}this._timers.push(setTimeout(function(){this._createRequest(this.INITIAL_PING).send();var a=this._createRequest(this.ONGOING_PING);this._timers.push(setInterval(a.send.bind(a),e))}.bind(this),d));f&&this._timers.push(setTimeout(function(){this._createRequest(this.DISCOVERY_PING).send()}.bind(this),f));b("Run").onBeforeUnload(this.onBeforeUnload.bind(this))},catchPageTransition:function(a){this._createRequest(this.ENDING_PING).send(),this.cleanup()},onBeforeUnload:function(){this._createRequest(this.ENDING_PING).send(),this.cleanup()},cleanup:function(){if(this._timers)for(var a=0;ac*g){var d=r[c];b("Banzai").post("canvas_playing_game",{played:d,app_id:q});delete r[c]}if(Date.now()-n>60*g){d=a+o;b("Banzai").post("canvas_time_spent",[d,q]);n=Date.now();o=0}else o=m?a+o:o}else t==s.CANVAS_INACTIVE&&u()&&(t=s.CANVAS_ACTIVE,m=Date.now(),n||(n=Date.now()),b("ScriptPath").openOverlayView("canvas"))}b("Banzai").subscribe(b("Banzai").SHUTDOWN,function(){u()&&b("ScriptPath").closeOverlayView("canvas",m?{ms_since_open:Date.now()-m}:null)});function w(a){__p&&__p();b("clickRefAction")("canvas",l,a,"FORCE").set_namespace("canvas");switch(a.type){case"beforeunload":k=!1;h=!1;i=!1;break;case"visible":k=!0;break;case"hidden":k=!1;break;case"mouseover":i=!0;break;case"mouseout":i=!1;break;case"focus":case"blur":h=b("getActiveElement")()==document.getElementById("iframe_canvas");break;default:break}v()}function x(a){var b=document.createEvent("FocusEvent");b.initEvent(a,!0,!0);return b}a={trackState:function(a,c){q=c,k=!b("Visibility").isHidden(),j=document.hasFocus(),h=b("getActiveElement")()==document.getElementById("iframe_canvas"),i=a.querySelector(":hover")!==null,v(),b("Event").listen(a,"mouseover",w),b("Event").listen(a,"mouseout",w),b("Event").listen(window,"blur",w),b("Event").listen(window,"focus",w),b("Event").listen(window,"beforeunload",w),b("Visibility").addListener("hidden",function(){return w(x("hidden"))}),b("Visibility").addListener("visible",function(){return w(x("visible"))}),b("setIntervalAcrossTransitions")(function(){j=document.hasFocus(),v()},g)}};e.exports=a}),null); __d("CanvasResizer",["CSS","DOMEventListener","Vector","createArrayFromMixed"],(function(a,b,c,d,e,f){__p&&__p();var g;function h(){__p&&__p();var a,c=document.documentElement;window.innerHeight?a=window.innerHeight:c&&c.clientHeight?a=c.clientHeight:a=document.body.clientHeight;for(var c=0;c0)d=-f.left;else{a=a.scrollWidth+f.left;var g=f.width;g>a&&(d=g-a)}f.top>0&&(e=-f.top);return{bottom:c.bottom+e,height:c.height,left:c.left+d,right:c.right+d,top:c.top+e,width:c.width}}e.exports=a}),null); __d("StickyArea",["cx","CSS","DOM","DOMQuery","Event","Run","Style","ViewportBounds","getNormalizedClientRect","getOverlayZIndex","getStyleProperty","removeFromArray","throttle"],(function(a,b,c,d,e,f,g){__p&&__p();var h=[],i=null,j=null,k=b("throttle").acrossTransitions(n,1e3),l="$$StickyArea_scrollListener",m="$$StickyArea_scrollListenerCount";function n(){h.sort(function(a,b){a=a.getNode();b=b.getNode();if(a.compareDocumentPosition)return 3-(a.compareDocumentPosition(b)&6);else return a.sourceIndex-b.sourceIndex})}function o(a,c,d){var e=a.getPlaceholder(),f=a.getNode(),g=b("Style").get(f,"float");a=a.getData();(a.placeholderWidth!==c||a.placeholderHeight!==d||a.placeholderFloat!==g)&&(b("Style").apply(e,{"float":g,height:d+"px",width:c+"px"}),a.placeholderHeight=d,a.placeholderWidth=c);f.nextSibling!==e&&b("DOM").insertAfter(f,e)}function p(a,c){var d=a.getData();d.fixed!==c&&(b("Style").apply(a.getNode(),d.styles),b("CSS").conditionShow(a.getPlaceholder(),c),b("CSS").conditionClass(a.getNode(),"_1a1e",c),b("Event").fire(a.getNode(),"change"),d.fixed=c)}function q(a,b){if(!a)return 0;else if(b.right<=a.rect.left||b.left>=a.rect.right)return q(a.prev,b);else return a.bottom}function r(){__p&&__p();var a=0,c=h.length,d=100,e=null;function f(g,i){__p&&__p();var j=d;while(am+u||!k.getIsBoundToContainer()){var A=parseInt(b("Style").get(l,"margin-left"),10);s.position="fixed";s.bottom="auto";s.top=m+w+"px";s.left=x.left-A+"px"}else{(!n.parent||r!==n.parent)&&(b("Style").get(r,"position")==="static"&&b("Style").set(r,"position","relative"),n.parent=r);s.position="absolute";s.top="auto";s.bottom=y+"px";w=parseInt(b("Style").get(r,"border-left-width"),10);s.left=x.left-z.left-w+"px"}o(k,v,u);p(k,!0)}a++;A={bottom:m+u,prev:g,rect:x};n=0;k.getIsBoundToContainer()||(e=A,n=100);f(A,r);y=k.getZIndexOverride()||d+++n;b("Style").set(l,"z-index",y)}}f(null,null)}a=function(){"use strict";__p&&__p();function a(c,d,e,f){f===void 0&&(f={}),this._isDestroyed=!1,this._node=c,this._data={fixed:!1,placeholderFloat:null,placeholderHeight:null,placeholderWidth:null,styles:{}},this._offset=e,this._boundToContainer=f.boundToContainer!==!1,f.stickTo===a.stickTo.SCROLL_PARENT?this._scrollTarget=b("Style").getScrollParent(c.parentNode)||window:this._scrollTarget=window,this._zIndexOverride=f.zIndexOverride,b("CSS").addClass(c,"_k"),d||b("Run").onLeave(this.destroy.bind(this)),!this._scrollTarget[l]?(this._scrollTarget[l]=b("Event").listen(this._scrollTarget,"scroll",function(){k(),r()}),this._scrollTarget[m]=1):this._scrollTarget[m]++,h.length||(i=b("Event").listen(window,"resize",function(){k(),r()}),j=b("ViewportBounds").subscribe("change",function(){k(),r()})),h.push(this),a.reflow()}var c=a.prototype;c.destroy=function(){__p&&__p();if(this._isDestroyed)return;b("removeFromArray")(h,this);this._scrollTarget[m]--;this._scrollTarget[m]===0&&(this._scrollTarget[l].remove(),this._scrollTarget[l]=null);h.length||(i.remove(),i=null,j.unsubscribe(),j=null);this._placeholder&&b("DOM").remove(this._placeholder);var a=0;for(var c in this._data.styles)this._data.styles[c]="",a++;a&&b("Style").apply(this._node,this._data.styles);this._isDestroyed=!0};c.getData=function(){return this._data};c.getNode=function(){return this._node};c.getOffset=function(){return this._offset||0};c.getPlaceholder=function(){this._placeholder||(this._placeholder=b("DOM").create("div"));return this._placeholder};c.getIsBoundToContainer=function(){return this._boundToContainer};c.getZIndexOverride=function(){return this._zIndexOverride};c.getZIndex=function(){this._zIndex||(this._zIndex=b("getOverlayZIndex")(this._node));return this._zIndex};c.setOffset=function(a){this._offset=a};return a}();a.reflow=b("throttle").acrossTransitions(function(){n(),r()},100);a.stickTo={SCROLL_PARENT:"SCROLL_PARENT",WINDOW:"WINDOW"};e.exports=a}),null);